package com.guigu.equipmentservice.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.guigu.equipmentservice.entity.EquipmentVideo;
import com.guigu.equipmentservice.mapper.EquipmentVideoMapper;
import com.guigu.equipmentservice.service.EquipmentVideoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * <p>
 * 设备视频表（存储设备的展示视频，可选上传） 服务实现类
 * </p>
 *
 * @author zcy
 * @since 2025-09-28
 */
@Service
public class EquipmentVideoServiceImpl extends ServiceImpl<EquipmentVideoMapper, EquipmentVideo> implements EquipmentVideoService {

    @Autowired
    private EquipmentVideoService equipmentVideoService;
    //根据EquipmentId查询设备视频
    @GetMapping("/getEquipmentById/{id}")
    public EquipmentVideo getEquipmentById(@PathVariable("id") Long id) {
        QueryWrapper<EquipmentVideo> wrapper = new QueryWrapper<>();
        wrapper.eq("equipment_id",id);
        return equipmentVideoService.getOne(wrapper);
    }
}
